{#

 This file is part of the FOSCommentBundle package.

 (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>

 This source file is subject to the MIT license that is bundled
 with this source code in the file LICENSE.

#}

{% block fos_comment_comment %}
<li id="fos_comment_{{ comment.id }}" class="{% if depth == 0 %}me{% else %}others{% endif %} fos_comment_comment_show fos_comment_comment_depth_{{ depth }}" {% if parentId is defined %}data-parent="{{ parentId }}"{% endif %}>
	<div class="thumbnail">
		<img src="{{ asset('assets/images/pp.jpg') }}" alt="Avatar">
	</div>

	<div class="message">
	    <div class="fos_comment_comment_metas">
	        {% block fos_comment_comment_metas %}
	        
				<div class="pull-{% if depth == 0 %}right{% else %}left{% endif %}">
{# 	            {% block fos_comment_comment_metas_delete %}#}
{# 	                {% if fos_comment_can_delete_comment(comment) %}#}
{# 						{% if comment is fos_comment_deleted %}#}
{# 	                        <button data-url="{{ url("fos_comment_remove_thread_comment", {"id": comment.thread.id, "commentId": comment.id, "value": constant('FOS\\CommentBundle\\Model\\CommentInterface::STATE_VISIBLE') }) }}" class="btn btn-inverse fos_comment_comment_remove">{% trans from 'FOSCommentBundle' %}fos_comment_comment_undelete{% endtrans %}</button>#}
{# 	                    {% else %}#}
{# 	                        <button data-url="{{ url("fos_comment_remove_thread_comment", {"id": comment.thread.id, "commentId": comment.id, "value":  constant('FOS\\CommentBundle\\Model\\CommentInterface::STATE_DELETED')}) }}" class="close fos_comment_comment_remove">×</button>#}
{# 	                    {% endif %}#}
{# 	                {% endif %}#}
{# 	            {% endblock fos_comment_comment_metas_delete %}#}
	            </div>
	            
	            {% block fos_comment_comment_metas_authorline %}
{# 	                {% trans from 'FOSCommentBundle' %}fos_comment_comment_show_by{% endtrans %}#}
	                <span class="name fos_comment_comment_authorname">
						{% if comment is fos_comment_deleted %}
	                <span class="label">Commentaire supprimé par l'administrateur</span>
	                    {% else %}
	                        {{ comment.authorName }}
	                    {% endif %}
	                </span>
	            {% endblock fos_comment_comment_metas_authorline %}
	        {% endblock fos_comment_comment_metas %}
	    </div>
	
	    <div class="fos_comment_comment_body">
	        {% block fos_comment_comment_body %}
				{% if comment is fos_comment_deleted %}
	                {% trans from 'FOSCommentBundle' %}fos_comment_comment_deleted{% endtrans %}
	            {% else %}
	                {% if comment is fos_comment_raw %}
	                    {{ comment.rawBody | raw }}
	                {% else %}
	                    {{ comment.body | nl2br }}
	                {% endif %}
	            {% endif %}
	        {% endblock fos_comment_comment_body %}
	    </div>
	    
	    <div class="fos_comment_comment_info">
	    	{% block fos_comment_comment_metas_voting %}
                {% if fos_comment_can_vote(comment) %}
                    <div class="fos_comment_comment_voting">
                        <button data-url="{{ url("fos_comment_new_thread_comment_votes", {"id": comment.thread.id, "commentId": comment.id, "value": 1}) }}" class="fos_comment_comment_vote">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_voteup{% endtrans %}</button>
                        <button data-url="{{ url("fos_comment_new_thread_comment_votes", {"id": comment.thread.id, "commentId": comment.id, "value": -1}) }}" class="fos_comment_comment_vote">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_votedown{% endtrans %}</button>
                        <div class="fos_comment_comment_score" id="fos_comment_score_{{ comment.id }}">{% include "FOSCommentBundle:Thread:comment_votes.html.twig" with { 'commentScore': comment.score } %}</div>
                    </div>
                {% endif %}
            {% endblock fos_comment_comment_metas_voting %}
	            
{# 	   		{% block fos_comment_comment_metas_edit %}#}
{#                 {% if fos_comment_can_edit_comment(comment) %}#}
{#                 <button data-url="{{ url("fos_comment_edit_thread_comment", {"id": comment.thread.id, "commentId": comment.id}) }}" class="btn pull-{% if depth == 0 %}right{% else %}left{% endif %} fos_comment_comment_edit_show_form">{% trans from 'FOSCommentBundle' %}fos_comment_comment_edit{% endtrans %}</button>#}
{#                 {% endif %}#}
{#             {% endblock fos_comment_comment_metas_edit %}#}
            
{#             {% if fos_comment_can_comment(comment) and depth == 0 %}#}
{#                 <div class="fos_comment_comment_reply pull-{% if depth == 0 %}right{% else %}left{% endif %}" style="padding:0 8px;">#}
{#                     {% block fos_comment_comment_reply %}#}
{#                         <button data-loading-text="Loading..." data-url="{{ url('fos_comment_new_thread_comments', {"id": comment.thread.id}) }}" data-name="{{ comment.authorName }}" data-parent-id="{{ comment.id }}" class="btn fos_comment_comment_reply_show_form">{% trans from 'FOSCommentBundle' %}fos_comment_comment_show_reply{% endtrans %}</button>#}
{#                     {% endblock fos_comment_comment_reply %}#}
{#                 </div>#}
{#             {% endif %}#}
            
            <span class="time pull-{% if depth == 0 %}left{% else %}right{% endif %}">{{ comment.createdAt|date('d/m/Y à H:i') }}</span>
            
            <div style="clear:both;"></div>
		</div>
	</div>

    {% block fos_comment_comment_children %}
        {% if view is not sameas('flat') %}

            <div class="fos_comment_comment_replies">

                {% if children is defined %}
                    {% include "IMTCommentBundle:Comment:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
                {% endif %}

            </div>
        {% elseif view is sameas('flat') and children is defined %}
            {% include "IMTCommentBundle:Comment:comments.html.twig" with { "comments": children, "depth": depth + 1, "parentId": comment.id, "view": view } %}
        {% endif %}
    {% endblock fos_comment_comment_children %}

</li>
{% endblock fos_comment_comment %}
